﻿using GalaSoft.MvvmLight;
using Services.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Books.ViewModel
{
    public class SeriesViewModel : ViewModelBase, ISeriesViewModel
    {
        private Series getSeriesList;
        public  GenreList GenreListData {get;set;}
        public SeriesViewModel()
        {

        }

        public async Task<Series> GetSeries(GenreList genreList)
        {
            GenreListData = genreList;
            var getData = await App.CallService.GetSeriesBooksAsync(genreList.genre_id, "30", "0");
            if (getData != null && getData.series_list.Count > 0)
                GetSeriesList = getData;
            return GetSeriesList;
        }
        public Series GetSeriesList
        {
            get
            {
               if(getSeriesList==null)
                   getSeriesList = new Series();
               return getSeriesList;
            }
            set
            {
                getSeriesList = value;
                RaisePropertyChanged("GetSeriesList");
            }
        }
    }
}
